module.exports = {
  //=>process.env.NODE_ENV：环境变量中存储的是开发环境还是生产环境
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  //=>outputDir
  //=>自定义目录名称，把生成的JS/CSS/图片等静态资源放置到这个目录中
  assetsDir: 'assets',
  //=>关闭生产环境下的资源映射（生产环境下不在创建xxx.js.map文件）
  productionSourceMap: false,
  //=>设置一些webpack配置项，用这些配置项和默认的配置项合并
  configureWebpack: config => {
    // config.entry.app = ["babel-polyfill", "./src/main.js"];
    //config.entry.app = ["core-js/stable","regenerator-runtime/runtime", "./src/main.js"];
    plugins: []
  },  
  lintOnSave:false,
  transpileDependencies: ['@carbon/vue'],//add carbon to babel-loader,see https://cli.vuejs.org/zh/config/#transpiledependencies
  chainWebpack: config => {
      config.module
          .rule('images')
          .use('url-loader')
          .loader('url-loader')
          .tap(options => {
              options.limit = 200 * 1024;
              return options;
          });
  },
  devServer: {
	    port:8200,
  	    proxy: {
	      "/apilocal": {
	        target: "http://localhost:80", 
	        changeOrigin: true, 
	        ws: true, 
	        pathRewrite: {
	          "^/apilocal": "/"
	        }
        },   
	      "/apigithub": {
	        target: "https://api.github.com", 
	        changeOrigin: true, 
	        ws: true, 
	        pathRewrite: {
	          "^/apigithub": "/"
	        }
        },              
	    }, 	    
  },
  parallel: require('os').cpus().length > 1
}